<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>打开一个持久的网络连接或者Unix套接字连接。</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.pfsockopen" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pfsockopen</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">pfsockopen</span> &mdash; <span class="dc-title">打开一个持久的网络连接或者Unix套接字连接。</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.pfsockopen-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pfsockopen</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$hostname</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$port</code><span class="initializer"> = -1</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter reference">&$errno</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter reference">&$errstr</code></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$timeout</code><span class="initializer"> = ini_get(&quot;default_socket_timeout&quot;)</span></span>
  ]]]] ) : <span class="type">resource</span></div>

  <p class="para rdfs-comment">
   这个函数的作用与<span class="function"><a href="fsockopen.html" class="function">fsockopen()</a></span>完全一样的，不同的地方在于当在脚本执行完后，连接一直不会关闭。可以说它是<span class="function"><a href="fsockopen.html" class="function">fsockopen()</a></span>的长连接版本。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pfsockopen-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   对于其参数的信息，请参考<span class="function"><a href="fsockopen.html" class="function">fsockopen()</a></span>的文档。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.pfsockopen-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="fsockopen.html" class="function" rel="rdfs-seeAlso">fsockopen()</a> - 打开一个网络连接或者一个Unix套接字连接</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>